<?php
/*************************************************************************************/
class Db {
	
function getsqlserv() {
 if(getenv("SERVER_NAME")=="php.proxad.net") {
	//weird case
	$host="sql.free.fr";
 }
 else {
	//standart case
	$host="sql.crow-orleans.fr";
 }
return $host;
}

function connect() {

include("./path.ini");

/*connect db class*/
$host=		$this->getsqlserv();
$user =		"myuser";
$passwd =	"mypassword";
$db =		"mydatabase";

@mysql_connect($host,$user,$passwd) or Header("Location: $ROOTURL/errhndl/mysqlcnx.php3");
@mysql_select_db("$db") or Header("Location: $ROOTURL/errhndl/mysqlcnx.php3");
return;
}

/*************************************************************************************/
function close() {
/*close connection*/
mysql_close();
return;
}	

};
?>
